﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:parts="clr-namespace:WTwitter.View.Parts;assembly=WTwitter">
	
	<FontFamily x:Key="BaseFontFamily">
		Meiryo UI
	</FontFamily>

	<!--すべてのControlで共通して利用するStyle-->
	<Style x:Key="BaseControlStyle" TargetType="{x:Type Control}">
		<Setter Property="FontFamily" Value="{StaticResource BaseFontFamily}"/>
	</Style>
	
	<!--ボタンの基本Style(ボタンのStyleをカスタマイズするときはこのStyleをBasedOnする)-->
	<Style x:Key="BaseButtonStyle" TargetType="{x:Type Button}"
		   BasedOn="{StaticResource BaseControlStyle}">
	</Style>

	<!--Styleを指定しないボタンに適用される-->
	<Style x:Key="{x:Type Button}" TargetType="{x:Type Button}"
		   BasedOn="{StaticResource BaseButtonStyle}"/>
	
	<!--TextBlockの基本Style-->
	<Style x:Key="BaseTextBlockStyle" TargetType="{x:Type TextBlock}">
		<Setter Property="FontFamily" Value="{StaticResource BaseFontFamily}"/>
	</Style>
	
	<!--Styleを指定しないテキストに適用される-->
	<Style x:Key="{x:Type TextBlock}" TargetType="{x:Type TextBlock}"
		   BasedOn="{StaticResource BaseTextBlockStyle}"/>

	<!--画像を表示するボタン-->
	<Style x:Key="ImageButtonStyle" TargetType="{x:Type Button}">
		<Setter Property="OverridesDefaultStyle" Value="True"/>
		<Setter Property="Background" Value="Transparent"/>
		<Setter Property="Cursor" Value="Hand"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type Button}">
					<Border Name="_container" CornerRadius="2" Background="Transparent">
						<ContentPresenter Name="Presenter" RenderTransformOrigin="0.5,0.5"/>
					</Border>
					<ControlTemplate.Triggers>
						<Trigger Property="IsMouseOver" Value="True">
							<Setter TargetName="_container" Property="Background" Value="{DynamicResource MouseOverBackgroundBrush}"/>
						</Trigger>
						<Trigger Property="IsPressed" Value="True">
							<Setter Property="RenderTransform" TargetName="Presenter">
								<Setter.Value>
									<TranslateTransform X="1" Y="1"/>
								</Setter.Value>
							</Setter>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<!--■発言部分のStyle■-->

	<!--テキスト-->
	<Style x:Key="DesignedTextBodyStyle" TargetType="{x:Type TextBlock}"
		   BasedOn="{StaticResource BaseTextBlockStyle}">
		<!--透過部分での使用を想定した影付き白抜き文字-->
		<Setter Property="FontFamily" Value="{StaticResource BaseFontFamily}"/>
		<Setter Property="Foreground" Value="White"/>
		<Setter Property="FontSize" Value="12"/>
		<Setter Property="FontWeight" Value="Bold"/>
		<Setter Property="BitmapEffect">
			<Setter.Value>
				<OuterGlowBitmapEffect GlowSize="3" GlowColor="Black" Noise="0"/>
			</Setter.Value>
		</Setter>
	</Style>
	
	<!--リンク-->
	<Style x:Key="DesignedHyperlinkStyle" TargetType="{x:Type Hyperlink}">
		<Setter Property="Foreground" Value="LightBlue"/>
	</Style>

	<!--ユーザー名-->
	<Style x:Key="DesignedUserNameHyperlinkStyle" TargetType="{x:Type Hyperlink}">
		<Setter Property="FontWeight" Value="Bold"/>
		<Setter Property="TextDecorations" Value="None"/>
	</Style>

	<!--■発言部分のStyle End■-->

	<!--■カスタマイズするWindow用のStyle■-->
	<!--※設定ダイアログなどには適用されないという意-->
	<!--Designed～Styleという名称にする-->

	<Style x:Key="DesignedTabControlStyle" TargetType="{x:Type TabControl}">
		<Setter Property="Background" Value="Transparent"/>
		<Setter Property="BorderBrush" Value="Transparent"/>
	</Style>

	<Style x:Key="DesignedListBoxStyle" TargetType="{x:Type ListBox}">
		<Setter Property="Background" Value="Transparent"/>
		<Setter Property="BorderBrush" Value="Transparent"/>
	</Style>

	<Style x:Key="DesignedButtonStyle" TargetType="{x:Type Button}">
		<Setter Property="Margin" Value="2"/>
		<Setter Property="Cursor" Value="Hand"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type Button}" >
					<Grid>
						<Border BorderThickness="2" CornerRadius="1" Name="border">
							<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
							<Border.BorderBrush>
								<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
									<GradientStop Color="LightGray" Offset="0"/>
									<GradientStop Color="DarkGray" Offset="0.5"/>
								</LinearGradientBrush>
							</Border.BorderBrush>
							<Border.Background>
								<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
									<GradientStop Color="White" Offset="0"/>
									<GradientStop Color="LightGray" Offset="1"/>
								</LinearGradientBrush>
							</Border.Background>
						</Border>
						<Rectangle Name="mouseOverColor" Fill="{DynamicResource MouseOverBackgroundBrush}" Opacity="0" />
					</Grid>
					<ControlTemplate.Triggers>
						<Trigger Property="IsMouseOver" Value="True">
							<Setter TargetName="mouseOverColor" Property="Opacity" Value="0.5"/>
						</Trigger>
						<Trigger Property="IsEnabled" Value="False">
							<Setter Property="Foreground" Value="DarkGray"/>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	
	<!--使わなくなったのでコメントアウト
	<Style x:Key="DesignedScrollBarStyle" TargetType="{x:Type ScrollBar}">
		<Setter Property="Opacity" Value="0.5"/>
	</Style>
	
	<Style x:Key="DesignedToolBarTray" TargetType="{x:Type ToolBarTray}">
		<Setter Property="Background" Value="Transparent"/>
	</Style>

	<Style x:Key="DesignedToolBar" TargetType="{x:Type ToolBar}">
		<Setter Property="Background" Value="Transparent"/>
	</Style>
	-->

	<Style x:Key="DesignedComboBoxStyle" TargetType="{x:Type ComboBox}"
		   BasedOn="{StaticResource BaseControlStyle}">
		<Setter Property="Background" Value="Transparent"/>
	</Style>

	<Style x:Key="DesignedTabItemStyle" TargetType="{x:Type TabItem}"
		   BasedOn="{StaticResource BaseControlStyle}">
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type TabItem}">
					<Border Name="_container"  Background="{DynamicResource ContentsBackgroundBrush}"
							CornerRadius="3" Cursor="Hand" Margin="2,0">
						<ContentPresenter ContentSource="Header" Margin="3"/>
					</Border>
					<ControlTemplate.Triggers>
						<Trigger Property="IsMouseOver" Value="True">
							<Setter TargetName="_container"  Property="Background" Value="{DynamicResource MouseOverBackgroundBrush}"/>
						</Trigger>
						<Trigger Property="IsSelected" Value="True">
							<Setter TargetName="_container"  Property="Background" Value="{DynamicResource SelectedContentBackgroundBrush}"/>
							<Setter TargetName="_container" Property="BorderThickness" Value="1"/>
							<Setter TargetName="_container" Property="BorderBrush" Value="Gray"/>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<!--入力していないときは半透明のTextBox-->
	<Style x:Key="DesignedSubTransparentTextBoxStyle" TargetType="{x:Type TextBox}"
		   BasedOn="{StaticResource BaseControlStyle}">
		<Setter Property="Background" Value="{DynamicResource TextBoxTransparentBrush}"/>
		<Style.Triggers>
			<Trigger Property="IsMouseOver" Value="True">
				<Setter Property="Background" Value="White"/>
			</Trigger>
		</Style.Triggers>
	</Style>
	
	<Style x:Key="DesignedWindowStyle" TargetType="{x:Type Window}">
		<Setter Property="Template" Value="{DynamicResource DesignedWindowTemplate}"/>
		<Setter Property="WindowStyle" Value="None"/>
		<Setter Property="Background" Value="Transparent"/>
		<Setter Property="AllowsTransparency" Value="True"/>
	</Style>

	<ControlTemplate x:Key="DesignedWindowTemplate" TargetType="{x:Type Window}">
		<DockPanel Background="Transparent">
			<parts:TitlebarView DockPanel.Dock="Top"/>
			<ContentControl Content="{TemplateBinding Property=Content}" Background="Transparent"/>
		</DockPanel>
	</ControlTemplate>
	
	<!--■カスタマイズするWindow用のStyle End■-->

</ResourceDictionary>